<CascadingAuthenticationState>
    <AuthorizeView>
        <Authorized>
            <Router AppAssembly="@typeof(Program).Assembly">
                <Found Context="routeData">
                    <RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
                </Found>
                <NotFound>
                    <LayoutView Layout="@typeof(MainLayout)">
                        <Result Status="404"
                                Title="404"
                                SubTitle="Sorry, the page you visited does not exist.">
                        </Result>
                    </LayoutView>
                </NotFound>
            </Router>
        </Authorized>
        <NotAuthorized>
            <Router AppAssembly="@typeof(Program).Assembly">
                <Found Context="routeData">
                    <RouteView RouteData="@routeData" DefaultLayout="@typeof(LoginLayout)" />
                </Found>
                <NotFound>
                    <LayoutView Layout="@typeof(LoginLayout)">
                        <Result Status="404"
                                Title="404"
                                SubTitle="Sorry, the page you visited does not exist.">
                        </Result>
                    </LayoutView>
                </NotFound>
            </Router>
            <RedirectToLogin />
        </NotAuthorized>
    </AuthorizeView>
</CascadingAuthenticationState>